﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using DataHelper;

namespace DAL
{
  public  class TaxDao
    {


      string tableName = "Wage_Tax";
      public bool Insert(SortedDictionary<string, string> sdList)
      {
          return new BuiltSQL().InsertTable(tableName, sdList);
      }

      public bool Update(SortedDictionary<string, string> sdList)
      {
          return new BuiltSQL().UpdateTable(tableName, sdList);
      }
        public DataTable GetOneInfo(string taxCode)
        {
            return SQLHelper.ExecuteSqlGetDrToDt("Select * from " + tableName + " where TaxCode='" + taxCode + "'");
        }

        public bool DeleteOneInfo(string taxCode)
        {
            return SQLHelper.ExecuteSql("delete from " + tableName + " where TaxCode='" + taxCode + "'");
        }
        public bool IsExistEmpCode(string taxCode)
        {
            DataTable dt = GetOneInfo(taxCode);
            if (dt.Rows.Count == 1)//如果存在该用户编号
                return true;
            else//否则
                return false;
        }
        public DataTable GetLists()
        {
            return SQLHelper.ExecuteSqlGetDrToDt("Select * from " + tableName + " Order by TaxCode ASC");
        }
     
      
    }
}
